package com.qfedu.lc.api.user;


import com.qfedu.lc.api.user.feigin.SmsLogService;
import com.qfedu.lc.api.user.feigin.UserService;
import com.qfedu.lc.common.param.UserAdd;
import com.qfedu.lc.common.param.UserLogin;
import com.qfedu.lc.common.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;


@RequestMapping("/api")
@Controller
public class UserController {



    @Autowired
    private UserService userService;

    @PostMapping("/user/register")
    @ResponseBody
    public R   registerUser(@RequestBody UserAdd userAdd){
        return userService.registerUser(userAdd);
    }


    @PostMapping("/user/loginpass")
    @ResponseBody
    public R loginPass(@RequestBody UserLogin userLogin){
        return userService.loginPass(userLogin);
    }


    @GetMapping("/user/logout")
    @ResponseBody
    public R logout(HttpServletRequest request){
        return userService.logout();
    }

}
